// pages/seach/index.js
Page({
  data: {
    list: [],
  },
  seachInput(e) {
    console.log(e.detail)
    var inpValue = e.detail.value
    if (inpValue != "") {
      wx.request({
        url: 'http://192.168.76.39/index.php?s=/api/goods/list',
        data: {
          goodsName: inpValue,
        },
        success: res => {
          console.log(res.data)
          var goods = res.data.data.list.data
          console.log(goods)
          this.setData({
            list: goods
          })
        }
      })
    }
  },
  shoppDetail(e) {
    //获取商品详情的商品id
    console.log(e.currentTarget.dataset.id)
    wx.navigateTo({
      url: '/pages/index/detail/index?goodsId=' + e.currentTarget.dataset.id,
    })
  },
})